#!/usr/bin/env python
# Copyright (C) 2007 by Xyhthyx <xyhthyx@gmail.com>

# This file is part of Parcellite.

# Parcellite is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.

# Parcellite is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

import os
import sys
from distutils.core import setup, Extension
from distutils.dep_util import newer

setup(name='Parcellite',
			description='Lightweight GTK+ clipboard manager.',
			version='0.4.1',
			author='Xyhthyx',
			author_email='xyhthyx@gmail.com',
			url='http://code.google.com/p/xyhthyx/',
			license='GPLv3',
			scripts=['parcellite'],
			py_modules=['parcellite'],
			data_files=[
			('/usr/share/applications', ['parcellite.desktop']),
			('/etc/xdg/autostart/', ['parcellite-startup.desktop']),
			],
			)

# Clean up temporary files
if os.path.exists('build/') and not 'build' in sys.argv:
	print 'Cleaning up temporary files...'
	for root, dirs, files in os.walk('build/', topdown=False):
		for each in files:
			# print 'Removing -> ' + os.path.join(root, name)
			os.remove(os.path.join(root, each))
		for each in dirs:
 			# print 'Removing -> ' + os.path.join(root, name)
 			os.rmdir(os.path.join(root, each))
 	# print 'Removing -> build'
 	os.rmdir('build/')
